#ifndef __BLEASTRIND_ASMVAR
#define __BLEASTRIND_ASMVAR
#include "../lookup/envfwd.h"
#include "../tuple/tuplefwd.h"
#include "registermanager.h"
#include <string>
namespace x86
{

	class AsmVar
	{
	public:
		AsmVar(const lookup::Env*,const pTupleElement,const RegisterManager&);
		

		bool haveRegister() const;
		RegisterManager::Register getRegister() const { return m_reg; }

		ConflictPair grabRegister(RegisterManager&);
		pTupleElement useRegister(RegisterManager::Register,RegisterManager&);

		std::string toString() const;



		friend bool operator == (const AsmVar& a,const AsmVar& b)
		{
			return a.m_pTupleElement == b.m_pTupleElement;
		}

		friend std::ostream &operator<<(std::ostream &os,const AsmVar &t)
		{
			os<<t.toString();
			return os;
		}

		
	private:
		std::string m_string;
		
		RegisterManager::Register m_reg;

		RegisterManager* m_pRegisterManager;
		
		pTupleElement m_pTupleElement;
		
	};
}//namespace
#endif
